package com.petAdoption.manager.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.petAdoption.manager.entity.Examineneck;
import com.petAdoption.manager.mapper.ExamineneckMapper;
import com.petAdoption.manager.mapper.NeckMapper;
import com.petAdoption.manager.service.IExamineneckService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.petAdoption.manager.vo.ExamineNeckVO;
import com.petAdoption.manager.vo.NeckVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 王倩茹
 * @since 2023-08-28
 */
@Service
public class ExamineneckServiceImpl extends ServiceImpl<ExamineneckMapper, Examineneck> implements IExamineneckService {
    @Resource
    private ExamineneckMapper mapper;
    @Override
    public List<ExamineNeckVO> findAll() {
        return mapper.findAll();
    }

    @Override
    public int updateStatus(Examineneck examineneck) {
        int examineneckStatus = mapper.update(examineneck,new UpdateWrapper<Examineneck>().set("examineneck_status",examineneck.getExamineneckStatus()).eq("examineneck_id",examineneck.getExamineneckId()));
        return examineneckStatus;
    }

    @Override
    public List<ExamineNeckVO> findByStatus(Integer examineneckStatus) {
        return mapper.findByStatus(examineneckStatus);
    }
}
